package com.learn.acm.design.observer;

/**
 * @author zhongshitao
 * @date 2020/11/5 6:18 下午
 */
public class Application {


    public static void main(String[] args) {
        Editor editor = new Editor();

        editor.eventManager.subscribe("open", new LoggingListener());
        editor.eventManager.subscribe("save", new EmailAlertsListener());

        try {
            editor.openFile("test.txt");
            editor.saveFile("abc");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
